using System;
namespace Microsoft.Phone.Controls
{
	internal static class AutoCompleteSearch
	{
		public static AutoCompleteFilterPredicate<string> GetFilter(AutoCompleteFilterMode FilterMode)
		{
			switch (FilterMode)
			{
			case AutoCompleteFilterMode.StartsWith:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.StartsWith);
			case AutoCompleteFilterMode.StartsWithCaseSensitive:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.StartsWithCaseSensitive);
			case AutoCompleteFilterMode.StartsWithOrdinal:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.StartsWithOrdinal);
			case AutoCompleteFilterMode.StartsWithOrdinalCaseSensitive:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.StartsWithOrdinalCaseSensitive);
			case AutoCompleteFilterMode.Contains:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.Contains);
			case AutoCompleteFilterMode.ContainsCaseSensitive:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.ContainsCaseSensitive);
			case AutoCompleteFilterMode.ContainsOrdinal:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.ContainsOrdinal);
			case AutoCompleteFilterMode.ContainsOrdinalCaseSensitive:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.ContainsOrdinalCaseSensitive);
			case AutoCompleteFilterMode.Equals:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.Equals);
			case AutoCompleteFilterMode.EqualsCaseSensitive:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.EqualsCaseSensitive);
			case AutoCompleteFilterMode.EqualsOrdinal:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.EqualsOrdinal);
			case AutoCompleteFilterMode.EqualsOrdinalCaseSensitive:
				return new AutoCompleteFilterPredicate<string>(AutoCompleteSearch.EqualsOrdinalCaseSensitive);
			}
			return null;
		}
		public static bool StartsWith(string text, string value)
		{
			return value.StartsWith(text, 1);
		}
		public static bool StartsWithCaseSensitive(string text, string value)
		{
			return value.StartsWith(text, 0);
		}
		public static bool StartsWithOrdinal(string text, string value)
		{
			return value.StartsWith(text, 5);
		}
		public static bool StartsWithOrdinalCaseSensitive(string text, string value)
		{
			return value.StartsWith(text, 4);
		}
		public static bool Contains(string text, string value)
		{
			return value.Contains(text, 1);
		}
		public static bool ContainsCaseSensitive(string text, string value)
		{
			return value.Contains(text, 0);
		}
		public static bool ContainsOrdinal(string text, string value)
		{
			return value.Contains(text, 5);
		}
		public static bool ContainsOrdinalCaseSensitive(string text, string value)
		{
			return value.Contains(text, 4);
		}
		public static bool Equals(string text, string value)
		{
			return value.Equals(text, 1);
		}
		public static bool EqualsCaseSensitive(string text, string value)
		{
			return value.Equals(text, 0);
		}
		public static bool EqualsOrdinal(string text, string value)
		{
			return value.Equals(text, 5);
		}
		public static bool EqualsOrdinalCaseSensitive(string text, string value)
		{
			return value.Equals(text, 4);
		}
	}
}
